package com.lxf.cn.quartz;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;


/**
 * Created by liaoxuefeng on 2018/11/12.
 */
//@Configuration
//@EnableScheduling
public class TaskScheduleConfig {

    @Bean
    public TaskScheduler scheduler() {
        ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();

        scheduler.setThreadNamePrefix("scheduler");

        scheduler.setPoolSize(10);
        return scheduler;
    }
}
